Optimal. Leaf size=73 \[ \frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {1}{2} a x (a-4 b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4132, 463, 459, 321, 203} \[ \frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {1}{2} a x (a-4 b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 321
Rule 459
Rule 463
Rule 4132
Rubi steps
\begin {align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^2(e+f x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (3 a^2-2 (a+b)^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}-\frac {(a (a-4 b)) \operatorname {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}+\frac {(a (a-4 b)) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {1}{2} a (a-4 b) x-\frac {a (a-4 b) \tan (e+f x)}{2 f}+\frac {a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.00, size = 126, normalized size = 1.73 \[ -\frac {\sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (3 a \cos ^3(e+f x) (a \sin (2 (e+f x))-2 f x (a-4 b))-4 b (6 a-b) \sec (e) \sin (f x) \cos ^2(e+f x)-4 b^2 \tan (e) \cos (e+f x)-4 b^2 \sec (e) \sin (f x)\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.58, size = 81, normalized size = 1.11 \[ \frac {3 \, {\left (a^{2} - 4 \, a b\right )} f x \cos \left (f x + e\right )^{3} - {\left (3 \, a^{2} \cos \left (f x + e\right )^{4} - 2 \, {\left (6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.37, size = 72, normalized size = 0.99 \[ \frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \, {\left (a^{2} - 4 \, a b\right )} {\left (f x + e\right )} - \frac {3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.52, size = 71, normalized size = 0.97 \[ \frac {a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (\tan \left (f x +e \right )-f x -e \right )+\frac {b^{2} \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.44, size = 67, normalized size = 0.92 \[ \frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \, {\left (a^{2} - 4 \, a b\right )} {\left (f x + e\right )} - \frac {3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.46, size = 94, normalized size = 1.29 \[ \frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {a^2\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,b^2-2\,b\,\left (a+b\right )\right )}{f}-\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (e+f\,x\right )\,\left (a-4\,b\right )}{2\,\left (2\,a\,b-\frac {a^2}{2}\right )}\right )\,\left (a-4\,b\right )}{2\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{2}{\left (e + f x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________